<?php 
/**
 * 验证码的入口文件
 * 根据当前环境所支持的函数情况来选择用何种方式显示验证码：FLASH或IMG或文字(暂不支持文字--无意义)
 * 
 * @copyright Copyright (c) 2008 sdmblog (http://www.sdmblog.cn)
 * @author sdomain(sdomain@live.cn)
 * @version makecode.php Sat May 17 17:14:05 CST 2008 php $
 */

//在URL重定向模式中，可能会路径出现错误，需要定义下面的变量来指定路径
$virdir='sdm/';
if (class_exists('SWFFont')) {
	//include_once('imgcode.php');
	//echo "<img src='./include/imgcode.php'/>";
	print '
				document.write(\'<object id="authcode" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="100" height="40">\');
  				document.write(\'<param name="movie" value="/'.$virdir.'include/flvcode.php">\')
  				document.write(\'<param name="quality" value="high">\')
  				document.write(\'<embed src="/'.$virdir.'include/flvcode.php" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="100" height="40"></embed></object>\')
';
}elseif (function_exists('imagecreate')) {
	print '
				document.write(\'<img id="authcode" src="/'.$virname.'include/imgcode.php?id=1"/>\');
			';
}else {
	print <<<END
				document.write('系统环境无支持任何方式的验证码输出功能');
END;
}

?> 